const apiurl="https://www.51houniao.com/";
const pagedata={
  request(url,type,data){
    wx.showLoading({
      title: '加载中...',
    })
    return new Promise((resolve,reject)=>{
      wx.request({
        url: apiurl+url,
        method:type,
        data:data,
        success:(res)=>{
          //影藏loading
          wx.hideLoading()
          resolve(res)
        },fail:(err)=>{
          wx.hideLoading()
          reject(err)
        }
      })
    })
  }
}
module.exports = {
  request:pagedata.request
}